/*
 * Copyright (c) 2005, 2014 vacoor
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.vacoor.nothing.demo.jaxws;

import org.springframework.stereotype.Component;

import javax.jws.WebService;
import javax.xml.ws.Endpoint;
import java.util.Arrays;

/**
 * @author vacoor
 */
@Component
@WebService(serviceName = "HelloWorldService", portName = "HelloWorldServicePort", endpointInterface = "org.vacoor.nothing.demo.jaxws.HelloWorldService")
//@WebService(endpointInterface = "org.vacoor.nothing.demo.jaxws.HelloWorldService")
public class HelloWorldServiceImpl implements HelloWorldService {

    @Override
    public String sayHello(String name) {
        return "Hello, " + name;
    }

    public static void main(String[] args) throws Exception {
        Object[] objects = null;//JaxWsFactoryBeanMapper.newInstance().invokeDynamicMethod("http://localhost:8080/webservice/test/HelloWorld?wsdl", "sayHello", "hehe");
        System.out.println(Arrays.toString(objects));
        System.exit(0);

        String targetEendPoint =  "http://localhost:8080/webservice/test/HelloWorld" ;

        HelloWorldService implementor = new HelloWorldServiceImpl();
        Endpoint.publish(targetEendPoint, implementor);

        /*
        Service service =  new Service();
        Call call = (Call) service.createCall();
        call.setTargetEndpointAddress( new URL(targetEendPoint));

        call.setOperationName( new  QName(targetEendPoint,  "sayHello" ));
        String result = (String) call.invoke( new  Object[]{ "Robert" });
        System.out.println(result);
        */
    }
}
